<?php

class contentSearch extends div
{
	public function __construct($args)
	{
        $fields[] = getThemeContent('contentSearch.html');
        parent::div('contentSearch', $fields);
	}

	public function doSearch($args)
	{
		global $news;

		if ($args['contentSearchTerm'])
		{
            $list = $news->contentSearch($args['contentSearchTerm']);
		}

		if ($list)
		{
			foreach ( $list as $line => $info)
			{
				$info['title'] = utf8_encode( $info['title'] );
				$content .= getThemeContent('contentSearchResult.html', $info );
			}
		}

		if (!$content)
		{
			$content = NO_REGISTER;
		}
		//var_dump($news->getByTitle('ninhada'));

		//var_dump($newList);
        return $content;
	}
}
?>